Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation regarding suggestion for expanding proc macros #1341

Closed

Conversation

fee1-dead
Copy link
Member

@fee1-dead fee1-dead commented Apr 15, 2022

This has been fixed by rust-lang/rust-analyzer#11956, but I am not sure if this should be suggested for everyone - including those only working on the library - but with the rustc wrapper the performance impact is minimal.

@spastorino
Copy link
Member

I'd guess we may want someone from t-libs to weigh in, if they are not interested in this suggestion maybe we can explicitly suggest one path for t-libs contributors and this one for t-compiler contributors.

@JohnTitor
Copy link
Member

JohnTitor commented May 16, 2022

but I am not sure if this should be suggested for everyone - including those only working on the library

I think we could also add a note about this for those who want to contribute to the libraries rather than the compiler.

(mistakenly closed, sorry!)

@JohnTitor JohnTitor closed this May 16, 2022
@JohnTitor JohnTitor reopened this May 16, 2022
@JohnTitor JohnTitor added the S-waiting-on-author Status: this PR is waiting for additional action by the OP label May 16, 2022
@spastorino
Copy link
Member

Should we merge this or what is it waiting on?

@JohnTitor
Copy link
Member

JohnTitor commented Jun 21, 2022

This has a merge conflict and I forgot to ping, @fee1-dead Could you resolve it and address #1341 (comment)?

@spastorino
Copy link
Member

From what I've seen in the source code of R-A, the current settings on the dev-guide are correct. We could just probably remove "rust-analyzer.cargo.buildScripts.enable": true and "rust-analyzer.procMacro.enable": true because those are true by default.

@fee1-dead fee1-dead changed the title Update suggested config to expand proc macros Fix documentation regarding suggestion for expanding proc macros Jun 27, 2022
@fee1-dead
Copy link
Member Author

fee1-dead commented Jul 1, 2022

@rustbot ready

@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2022

Error: The feature shortcut is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@JohnTitor
Copy link
Member

JohnTitor commented Jul 3, 2022

Sorry, I made another conflict by #1380 and #1381, could you also order like below?

{
    "rust-analyzer.checkOnSave.overrideCommand": [
        "python3",
        "x.py",
        "check",
        "--json-output"
    ],
    "rust-analyzer.rustfmt.overrideCommand": [
        "./build/$TARGET_TRIPLE/stage0/bin/rustfmt",
        "--edition=2021"
    ],
    "rust-analyzer.procMacro.enable": true,
    "rust-analyzer.cargo.buildScripts.enable": true,
    "rust-analyzer.cargo.buildScripts.overrideCommand": [
        "./build/$TARGET_TRIPLE/stage0/bin/cargo",
        "check",
        "-p",
        "rustc_driver",
        "--message-format=json"
    ],
    "rust-analyzer.cargo.useRustcWrapperForBuildScripts": true,
    "rust-analyzer.rustc.source": "./Cargo.toml",
    "rust-analyzer.linkedProjects": [
        "Cargo.toml",
        "src/bootstrap/Cargo.toml"
    ]
}

@spastorino
Copy link
Member

@JohnTitor from what I see on R-A source code https://github.com/rust-lang/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs, rust-analyzer.procMacro.enable is true by default, rust-analyzer.cargo.buildScripts.enable also true by default and rust-analyzer.cargo.useRustcWrapperForBuildScripts is now rust-analyzer.cargo.buildScripts.useRustcWrapper but seems to be a rename in place, anyway it's true by default. So I'd remove those 3 from the suggestions.

@fee1-dead
Copy link
Member Author

So I'd remove those 3 from the suggestions.

Those configuration are there so we can suggest to people in libs to disable them later and would make the instructions clearer.

> the version `2022-04-14` this was fixed by introducing an option for customizing
> the command rust-analyzer uses to run build scripts. Please ensure that `rust-analyzer`
> is up to date before enabling these options. If you do not wish to enable
> `rust-analyzer.cargo.useRustcWrapperForBuildScripts`, the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above the option is called rust-analyzer.cargo.buildScripts.useRustcWrapper, but here it is called by a different name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It got renamed, rust-analyzer.cargo.buildScripts.useRustcWrapper is the new name and rust-analyzer.cargo.useRustcWrapperForBuildScripts is the old name that would still work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sentence should be left out anyway.

@@ -38,8 +38,9 @@ you can write: <!-- date: 2022-04 --><!-- the date comment is for the edition be
],
"rust-analyzer.procMacro.enable": true,
"rust-analyzer.cargo.buildScripts.enable": true,
"rust-analyzer.cargo.buildScripts.useRustcWrapper": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be set by default, why set it explicitly here?
(Same for the enable options.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answered above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to not have these lines.

  • If people have this explicitly globally disabled, we should respect that.
  • For the libs suggestion, we can just have another code block saying "also add these things".

@fee1-dead
Copy link
Member Author

closing, as #1384 is better

@fee1-dead fee1-dead closed this Jul 5, 2022
@fee1-dead fee1-dead deleted the suggested-config branch March 18, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: this PR is waiting for additional action by the OP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants